<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.StgToCmm.Types</span><span>
</span><span id="line-4"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#CgInfos"><span class="hs-identifier">CgInfos</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-5"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#LambdaFormInfo"><span class="hs-identifier">LambdaFormInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-6"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#ModuleLFInfos"><span class="hs-identifier">ModuleLFInfos</span></a></span><span>
</span><span id="line-7"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#Liveness"><span class="hs-identifier">Liveness</span></a></span><span>
</span><span id="line-8"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgDescr"><span class="hs-identifier">ArgDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-9"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#StandardFormInfo"><span class="hs-identifier">StandardFormInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-10"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier">WordOff</span></a></span><span>
</span><span id="line-11"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-comment">{-
Note [Conveying CAF-info and LFInfo between modules]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some information about an Id is generated in the code generator, and is not
available earlier.  Namely:

* CAF info.   Code motion in Cmm or earlier phases may move references around so
  we compute information about which bits of code refer to which CAF late in the
  Cmm pipeline.

* LambdaFormInfo. This records the details of a closure representation,
  including
    - the final arity (for functions)
    - whether it is a data constructor, and if so its tag

Collectively we call this CgInfo (see GHC.StgToCmm.Types).

It's very useful for importing modules to have this information. We can always
make a conservative assumption, but that is bad: e.g.

* For CAF info, if we know nothing we have to assume it is a CAF which bloats
  the SRTs of the importing module.

  Conservative assumption here is made when creating new Ids.

* For data constructors, we really like having well-tagged pointers. See #14677,
  #16559, #15155, and wiki: commentary/rts/haskell-execution/pointer-tagging

  Conservative assumption here is made when we import an Id without a
  LambdaFormInfo in the interface, in GHC.StgToCmm.Closure.mkLFImported.

So we arrange to always serialise this information into the interface file.  The
moving parts are:

* We record the CgInfo in the IdInfo of the Id.

* GHC.Driver.Pipeline: the call to updateModDetailsIdInfos augments the
  ModDetails constructed at the end of the Core pipeline, with CgInfo
  gleaned from the back end.  The hard work is done in GHC.Iface.UpdateIdInfos.

* For ModIface we generate the final ModIface with CgInfo in
  GHC.Iface.Make.mkFullIface.

* We don't absolutely guarantee to serialise the CgInfo: we won't if you have
  -fomit-interface-pragmas or -fno-code; and we won't read it in if you have
  -fignore-interface-pragmas.  (We could revisit this decision.)
-}</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- | Codegen-generated Id infos, to be passed to downstream via interfaces.</span><span>
</span><span id="line-73"></span><span class="hs-comment">--</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- This stuff is for optimization purposes only, they're not compulsory.</span><span>
</span><span id="line-75"></span><span class="hs-comment">--</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- * When CafInfo of an imported Id is not known it's safe to treat it as CAFFY.</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- * When LambdaFormInfo of an imported Id is not known it's safe to treat it as</span><span>
</span><span id="line-78"></span><span class="hs-comment">--   `LFUnknown True` (which just says &quot;it could be anything&quot; and we do slow</span><span>
</span><span id="line-79"></span><span class="hs-comment">--   entry).</span><span>
</span><span id="line-80"></span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- See also Note [Conveying CAF-info and LFInfo between modules] above.</span><span>
</span><span id="line-82"></span><span class="hs-comment">--</span><span>
</span><span id="line-83"></span><span class="hs-keyword">data</span><span> </span><span id="CgInfos"><span class="annot"><a href="GHC.StgToCmm.Types.html#CgInfos"><span class="hs-identifier hs-var">CgInfos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="CgInfos"><span class="annot"><a href="GHC.StgToCmm.Types.html#CgInfos"><span class="hs-identifier hs-var">CgInfos</span></a></span></span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="cgNonCafs"><span class="annot"><span class="annottext">CgInfos -&gt; NonCaffySet
</span><a href="GHC.StgToCmm.Types.html#cgNonCafs"><span class="hs-identifier hs-var hs-var">cgNonCafs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Types.Name.Set.html#NonCaffySet"><span class="hs-identifier hs-type">NonCaffySet</span></a></span><span>
</span><span id="line-85"></span><span>      </span><span class="hs-comment">-- ^ Exported Non-CAFFY closures in the current module. Everything else is</span><span>
</span><span id="line-86"></span><span>      </span><span class="hs-comment">-- either not exported of CAFFY.</span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="cgLFInfos"><span class="annot"><span class="annottext">CgInfos -&gt; ModuleLFInfos
</span><a href="GHC.StgToCmm.Types.html#cgLFInfos"><span class="hs-identifier hs-var hs-var">cgLFInfos</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.StgToCmm.Types.html#ModuleLFInfos"><span class="hs-identifier hs-type">ModuleLFInfos</span></a></span><span>
</span><span id="line-88"></span><span>      </span><span class="hs-comment">-- ^ LambdaFormInfos of exported closures in the current module.</span><span>
</span><span id="line-89"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-92"></span><span class="hs-comment">--                LambdaFormInfo</span><span>
</span><span id="line-93"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | Maps names in the current module to their LambdaFormInfos</span><span>
</span><span id="line-96"></span><span class="hs-keyword">type</span><span> </span><span id="ModuleLFInfos"><span class="annot"><a href="GHC.StgToCmm.Types.html#ModuleLFInfos"><span class="hs-identifier hs-var">ModuleLFInfos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#LambdaFormInfo"><span class="hs-identifier hs-type">LambdaFormInfo</span></a></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="hs-comment">-- | Information about an identifier, from the code generator's point of view.</span><span>
</span><span id="line-99"></span><span class="hs-comment">-- Every identifier is bound to a LambdaFormInfo in the environment, which gives</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- the code generator enough info to be able to tail call or return that</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- identifier.</span><span>
</span><span id="line-102"></span><span class="hs-keyword">data</span><span> </span><span id="LambdaFormInfo"><span class="annot"><a href="GHC.StgToCmm.Types.html#LambdaFormInfo"><span class="hs-identifier hs-var">LambdaFormInfo</span></a></span></span><span>
</span><span id="line-103"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="LFReEntrant"><span class="annot"><a href="GHC.StgToCmm.Types.html#LFReEntrant"><span class="hs-identifier hs-var">LFReEntrant</span></a></span></span><span>         </span><span class="hs-comment">-- Reentrant closure (a function)</span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier hs-type">TopLevelFlag</span></a></span><span>   </span><span class="hs-comment">-- True if top level</span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Types.Basic.html#RepArity"><span class="hs-identifier hs-type">RepArity</span></a></span><span>       </span><span class="hs-comment">-- Arity. Invariant: always &gt; 0</span><span>
</span><span id="line-106"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>           </span><span class="hs-comment">-- True &lt;=&gt; no fvs</span><span>
</span><span id="line-107"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgDescr"><span class="hs-identifier hs-type">ArgDescr</span></a></span><span>       </span><span class="hs-comment">-- Argument descriptor (should really be in ClosureInfo)</span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LFThunk"><span class="annot"><a href="GHC.StgToCmm.Types.html#LFThunk"><span class="hs-identifier hs-var">LFThunk</span></a></span></span><span>             </span><span class="hs-comment">-- Thunk (zero arity)</span><span>
</span><span id="line-110"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier hs-type">TopLevelFlag</span></a></span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>           </span><span class="hs-comment">-- True &lt;=&gt; no free vars</span><span>
</span><span id="line-112"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>           </span><span class="hs-comment">-- True &lt;=&gt; updatable (i.e., *not* single-entry)</span><span>
</span><span id="line-113"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.StgToCmm.Types.html#StandardFormInfo"><span class="hs-identifier hs-type">StandardFormInfo</span></a></span><span>
</span><span id="line-114"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>           </span><span class="hs-comment">-- True &lt;=&gt; *might* be a function type</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LFCon"><span class="annot"><a href="GHC.StgToCmm.Types.html#LFCon"><span class="hs-identifier hs-var">LFCon</span></a></span></span><span>               </span><span class="hs-comment">-- A saturated constructor application</span><span>
</span><span id="line-117"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>        </span><span class="hs-comment">-- The constructor</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LFUnknown"><span class="annot"><a href="GHC.StgToCmm.Types.html#LFUnknown"><span class="hs-identifier hs-var">LFUnknown</span></a></span></span><span>           </span><span class="hs-comment">-- Used for function arguments and imported things.</span><span>
</span><span id="line-120"></span><span>                        </span><span class="hs-comment">-- We know nothing about this closure.</span><span>
</span><span id="line-121"></span><span>                        </span><span class="hs-comment">-- Treat like updatable &quot;LFThunk&quot;...</span><span>
</span><span id="line-122"></span><span>                        </span><span class="hs-comment">-- Imported things which we *do* know something about use</span><span>
</span><span id="line-123"></span><span>                        </span><span class="hs-comment">-- one of the other LF constructors (eg LFReEntrant for</span><span>
</span><span id="line-124"></span><span>                        </span><span class="hs-comment">-- known functions)</span><span>
</span><span id="line-125"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>           </span><span class="hs-comment">-- True &lt;=&gt; *might* be a function type</span><span>
</span><span id="line-126"></span><span>                        </span><span class="hs-comment">--      The False case is good when we want to enter it,</span><span>
</span><span id="line-127"></span><span>                        </span><span class="hs-comment">--        because then we know the entry code will do</span><span>
</span><span id="line-128"></span><span>                        </span><span class="hs-comment">--        For a function, the entry code is the fast entry point</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LFUnlifted"><span class="annot"><a href="GHC.StgToCmm.Types.html#LFUnlifted"><span class="hs-identifier hs-var">LFUnlifted</span></a></span></span><span>          </span><span class="hs-comment">-- A value of unboxed type;</span><span>
</span><span id="line-131"></span><span>                        </span><span class="hs-comment">-- always a value, needs evaluation</span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LFLetNoEscape"><span class="annot"><a href="GHC.StgToCmm.Types.html#LFLetNoEscape"><span class="hs-identifier hs-var">LFLetNoEscape</span></a></span></span><span>       </span><span class="hs-comment">-- See LetNoEscape module for precise description</span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680843229"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#LambdaFormInfo"><span class="hs-identifier hs-type">LambdaFormInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-136"></span><span>    </span><span id="local-6989586621680843218"><span class="annot"><span class="annottext">ppr :: LambdaFormInfo -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#LFReEntrant"><span class="hs-identifier hs-type">LFReEntrant</span></a></span><span> </span><span id="local-6989586621680843216"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621680843216"><span class="hs-identifier hs-var">top</span></a></span></span><span> </span><span id="local-6989586621680843215"><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843215"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621680843214"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843214"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span id="local-6989586621680843213"><span class="annot"><span class="annottext">ArgDescr
</span><a href="#local-6989586621680843213"><span class="hs-identifier hs-var">argdesc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-137"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LFReEntrant&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span>
</span><span id="line-138"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopLevelFlag -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621680843216"><span class="hs-identifier hs-var">top</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843215"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprFvs"><span class="hs-identifier hs-var">pprFvs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843214"><span class="hs-identifier hs-var">fvs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ArgDescr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ArgDescr
</span><a href="#local-6989586621680843213"><span class="hs-identifier hs-var">argdesc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#LFThunk"><span class="hs-identifier hs-type">LFThunk</span></a></span><span> </span><span id="local-6989586621680843207"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621680843207"><span class="hs-identifier hs-var">top</span></a></span></span><span> </span><span id="local-6989586621680843206"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843206"><span class="hs-identifier hs-var">hasfv</span></a></span></span><span> </span><span id="local-6989586621680843205"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843205"><span class="hs-identifier hs-var">updateable</span></a></span></span><span> </span><span id="local-6989586621680843204"><span class="annot"><span class="annottext">StandardFormInfo
</span><a href="#local-6989586621680843204"><span class="hs-identifier hs-var">sfi</span></a></span></span><span> </span><span id="local-6989586621680843203"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843203"><span class="hs-identifier hs-var">m_function</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-140"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LFThunk&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span>
</span><span id="line-141"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopLevelFlag -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621680843207"><span class="hs-identifier hs-var">top</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprFvs"><span class="hs-identifier hs-var">pprFvs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843206"><span class="hs-identifier hs-var">hasfv</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprUpdateable"><span class="hs-identifier hs-var">pprUpdateable</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843205"><span class="hs-identifier hs-var">updateable</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-142"></span><span>         </span><span class="annot"><span class="annottext">StandardFormInfo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">StandardFormInfo
</span><a href="#local-6989586621680843204"><span class="hs-identifier hs-var">sfi</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprFuncFlag"><span class="hs-identifier hs-var">pprFuncFlag</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843203"><span class="hs-identifier hs-var">m_function</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#LFCon"><span class="hs-identifier hs-type">LFCon</span></a></span><span> </span><span id="local-6989586621680843200"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680843200"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-144"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LFCon&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680843200"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#LFUnknown"><span class="hs-identifier hs-type">LFUnknown</span></a></span><span> </span><span id="local-6989586621680843199"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843199"><span class="hs-identifier hs-var">m_func</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-146"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LFUnknown&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprFuncFlag"><span class="hs-identifier hs-var">pprFuncFlag</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680843199"><span class="hs-identifier hs-var">m_func</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LambdaFormInfo
</span><a href="GHC.StgToCmm.Types.html#LFUnlifted"><span class="hs-identifier hs-var">LFUnlifted</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-148"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LFUnlifted&quot;</span></span><span>
</span><span id="line-149"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LambdaFormInfo
</span><a href="GHC.StgToCmm.Types.html#LFLetNoEscape"><span class="hs-identifier hs-var">LFLetNoEscape</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-150"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LFLetNoEscape&quot;</span></span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.StgToCmm.Types.html#pprFvs"><span class="hs-identifier hs-type">pprFvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-153"></span><span id="pprFvs"><span class="annot"><span class="annottext">pprFvs :: Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprFvs"><span class="hs-identifier hs-var hs-var">pprFvs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no-fvs&quot;</span></span><span>
</span><span id="line-154"></span><span class="annot"><a href="GHC.StgToCmm.Types.html#pprFvs"><span class="hs-identifier hs-var">pprFvs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fvs&quot;</span></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="annot"><a href="GHC.StgToCmm.Types.html#pprFuncFlag"><span class="hs-identifier hs-type">pprFuncFlag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-157"></span><span id="pprFuncFlag"><span class="annot"><span class="annottext">pprFuncFlag :: Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprFuncFlag"><span class="hs-identifier hs-var hs-var">pprFuncFlag</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mFunc&quot;</span></span><span>
</span><span id="line-158"></span><span class="annot"><a href="GHC.StgToCmm.Types.html#pprFuncFlag"><span class="hs-identifier hs-var">pprFuncFlag</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;value&quot;</span></span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="annot"><a href="GHC.StgToCmm.Types.html#pprUpdateable"><span class="hs-identifier hs-type">pprUpdateable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-161"></span><span id="pprUpdateable"><span class="annot"><span class="annottext">pprUpdateable :: Bool -&gt; SDoc
</span><a href="GHC.StgToCmm.Types.html#pprUpdateable"><span class="hs-identifier hs-var hs-var">pprUpdateable</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;updateable&quot;</span></span><span>
</span><span id="line-162"></span><span class="annot"><a href="GHC.StgToCmm.Types.html#pprUpdateable"><span class="hs-identifier hs-var">pprUpdateable</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneshot&quot;</span></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- | We represent liveness bitmaps as a Bitmap (whose internal representation</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- really is a bitmap).  These are pinned onto case return vectors to indicate</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- the state of the stack for the garbage collector.</span><span>
</span><span id="line-169"></span><span class="hs-comment">--</span><span>
</span><span id="line-170"></span><span class="hs-comment">-- In the compiled program, liveness bitmaps that fit inside a single word</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- (StgWord) are stored as a single word, while larger bitmaps are stored as a</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- pointer to an array of words.</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-keyword">type</span><span> </span><span id="Liveness"><span class="annot"><a href="GHC.StgToCmm.Types.html#Liveness"><span class="hs-identifier hs-var">Liveness</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- One Bool per word; True  &lt;=&gt; non-ptr or dead</span><span>
</span><span id="line-175"></span><span>                         </span><span class="hs-comment">--                    False &lt;=&gt; ptr</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- | An ArgDescr describes the argument pattern of a function</span><span>
</span><span id="line-179"></span><span>
</span><span id="line-180"></span><span class="hs-keyword">data</span><span> </span><span id="ArgDescr"><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgDescr"><span class="hs-identifier hs-var">ArgDescr</span></a></span></span><span>
</span><span id="line-181"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="ArgSpec"><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgSpec"><span class="hs-identifier hs-var">ArgSpec</span></a></span></span><span>             </span><span class="hs-comment">-- Fits one of the standard patterns</span><span>
</span><span id="line-182"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>            </span><span class="hs-comment">-- RTS type identifier ARG_P, ARG_N, ...</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ArgGen"><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgGen"><span class="hs-identifier hs-var">ArgGen</span></a></span></span><span>              </span><span class="hs-comment">-- General case</span><span>
</span><span id="line-185"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Types.html#Liveness"><span class="hs-identifier hs-type">Liveness</span></a></span><span>        </span><span class="hs-comment">-- Details about the arguments</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ArgUnknown"><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgUnknown"><span class="hs-identifier hs-var">ArgUnknown</span></a></span></span><span>          </span><span class="hs-comment">-- For imported binds.</span><span>
</span><span id="line-188"></span><span>                        </span><span class="hs-comment">-- Invariant: Never Unknown for binds of the module</span><span>
</span><span id="line-189"></span><span>                        </span><span class="hs-comment">-- we are compiling.</span><span>
</span><span id="line-190"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680843187"><span id="local-6989586621680843194"><span class="annot"><span class="annottext">ArgDescr -&gt; ArgDescr -&gt; Bool
(ArgDescr -&gt; ArgDescr -&gt; Bool)
-&gt; (ArgDescr -&gt; ArgDescr -&gt; Bool) -&gt; Eq ArgDescr
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: ArgDescr -&gt; ArgDescr -&gt; Bool
$c/= :: ArgDescr -&gt; ArgDescr -&gt; Bool
== :: ArgDescr -&gt; ArgDescr -&gt; Bool
$c== :: ArgDescr -&gt; ArgDescr -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680843182"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgDescr"><span class="hs-identifier hs-type">ArgDescr</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-193"></span><span>  </span><span id="local-6989586621680843176"><span class="annot"><span class="annottext">ppr :: ArgDescr -&gt; SDoc
</span><a href="#local-6989586621680843176"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgSpec"><span class="hs-identifier hs-type">ArgSpec</span></a></span><span> </span><span id="local-6989586621680843175"><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843175"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ArgSpec&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843175"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-194"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#ArgGen"><span class="hs-identifier hs-type">ArgGen</span></a></span><span> </span><span id="local-6989586621680843174"><span class="annot"><span class="annottext">Liveness
</span><a href="#local-6989586621680843174"><span class="hs-identifier hs-var">ls</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ArgGen&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Liveness -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Liveness
</span><a href="#local-6989586621680843174"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-195"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ArgDescr
</span><a href="GHC.StgToCmm.Types.html#ArgUnknown"><span class="hs-identifier hs-var">ArgUnknown</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ArgUnknown&quot;</span></span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- | StandardFormInfo tells whether this thunk has one of a small number of</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- standard forms</span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="hs-keyword">data</span><span> </span><span id="StandardFormInfo"><span class="annot"><a href="GHC.StgToCmm.Types.html#StandardFormInfo"><span class="hs-identifier hs-var">StandardFormInfo</span></a></span></span><span>
</span><span id="line-202"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="NonStandardThunk"><span class="annot"><a href="GHC.StgToCmm.Types.html#NonStandardThunk"><span class="hs-identifier hs-var">NonStandardThunk</span></a></span></span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">-- The usual case: not of the standard forms</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SelectorThunk"><span class="annot"><a href="GHC.StgToCmm.Types.html#SelectorThunk"><span class="hs-identifier hs-var">SelectorThunk</span></a></span></span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-comment">-- A SelectorThunk is of form</span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-comment">--      case x of</span><span>
</span><span id="line-208"></span><span>        </span><span class="hs-comment">--           con a1,..,an -&gt; ak</span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-comment">-- and the constructor is from a single-constr type.</span><span>
</span><span id="line-210"></span><span>       </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-type">WordOff</span></a></span><span>         </span><span class="hs-comment">-- 0-origin offset of ak within the &quot;goods&quot; of</span><span>
</span><span id="line-211"></span><span>                        </span><span class="hs-comment">-- constructor (Recall that the a1,...,an may be laid</span><span>
</span><span id="line-212"></span><span>                        </span><span class="hs-comment">-- out in the heap in a non-obvious order.)</span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ApThunk"><span class="annot"><a href="GHC.StgToCmm.Types.html#ApThunk"><span class="hs-identifier hs-var">ApThunk</span></a></span></span><span>
</span><span id="line-215"></span><span>        </span><span class="hs-comment">-- An ApThunk is of form</span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-comment">--        x1 ... xn</span><span>
</span><span id="line-217"></span><span>        </span><span class="hs-comment">-- The code for the thunk just pushes x2..xn on the stack and enters x1.</span><span>
</span><span id="line-218"></span><span>        </span><span class="hs-comment">-- There are a few of these (for 1 &lt;= n &lt;= MAX_SPEC_AP_SIZE) pre-compiled</span><span>
</span><span id="line-219"></span><span>        </span><span class="hs-comment">-- in the RTS to save space.</span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Types.Basic.html#RepArity"><span class="hs-identifier hs-type">RepArity</span></a></span><span>       </span><span class="hs-comment">-- Arity, n</span><span>
</span><span id="line-221"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680843165"><span id="local-6989586621680843169"><span class="annot"><span class="annottext">StandardFormInfo -&gt; StandardFormInfo -&gt; Bool
(StandardFormInfo -&gt; StandardFormInfo -&gt; Bool)
-&gt; (StandardFormInfo -&gt; StandardFormInfo -&gt; Bool)
-&gt; Eq StandardFormInfo
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: StandardFormInfo -&gt; StandardFormInfo -&gt; Bool
$c/= :: StandardFormInfo -&gt; StandardFormInfo -&gt; Bool
== :: StandardFormInfo -&gt; StandardFormInfo -&gt; Bool
$c== :: StandardFormInfo -&gt; StandardFormInfo -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="hs-comment">-- | Word offset, or word count</span><span>
</span><span id="line-224"></span><span class="hs-keyword">type</span><span> </span><span id="WordOff"><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-var">WordOff</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680843162"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#StandardFormInfo"><span class="hs-identifier hs-type">StandardFormInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-227"></span><span>  </span><span id="local-6989586621680843159"><span class="annot"><span class="annottext">ppr :: StandardFormInfo -&gt; SDoc
</span><a href="#local-6989586621680843159"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><span class="annottext">StandardFormInfo
</span><a href="GHC.StgToCmm.Types.html#NonStandardThunk"><span class="hs-identifier hs-var">NonStandardThunk</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RegThunk&quot;</span></span><span>
</span><span id="line-228"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#SelectorThunk"><span class="hs-identifier hs-type">SelectorThunk</span></a></span><span> </span><span id="local-6989586621680843158"><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843158"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;SelThunk:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843158"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-229"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Types.html#ApThunk"><span class="hs-identifier hs-type">ApThunk</span></a></span><span> </span><span id="local-6989586621680843157"><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843157"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ApThunk:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RepArity
</span><a href="#local-6989586621680843157"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-230"></span></pre></body></html>